function getToolbar(type, root) {
    var vl = $('<ul class="am-navbar-nav am-cf am-avg-sm-4" style="  padding: 0;"></ul>');
    var index = $('<li id="index"></li>');
    index.append('<a href="' + root + '/Home/Index/index"><span class="am-icon-home"></span><span class="am-navbar-label">首页</span></a>');
    var category = $('<li></li>');
    category.append('<a href="' + root + '/Home/Goods/category"><span class="am-icon-list-ul"></span><span class="am-navbar-label">分类</span></a>');
    var kaituan = $('<li></li>');
    kaituan.append('<a href="' + root + '/Home/Goods/readyKaituan"><span class="am-icon-qrcode"></span><span class="am-navbar-label">开团</span></a>');
    var shared = $('<li></li>');
    shared.append('<a href="' + root + '/Home/Comment/comment"><span class="am-icon-camera"></span><span class="am-navbar-label">晒单</span></a>');
    var my = $('<li></li>');
    my.append('<a href="' + root + '/Home/MyInfo/my"><span class="am-icon-user"></span><span class="am-navbar-label">我的</span></a>');
    console.info(type);
    if (type == 'index') {
        index.addClass('bottom_active');
    } else if (type == 'category') {
        category.addClass('bottom_active');
    } else if (type == 'kaituan') {
        kaituan.addClass('bottom_active');
    } else if (type == 'shared') {
        shared.addClass('bottom_active');
    } else if (type == 'my') {
        my.addClass('bottom_active');
    }
    vl.append(index);
    vl.append(category);
    vl.append(kaituan);
    vl.append(shared);
    vl.append(my);
    return vl;
}

function ajaxPublicAdd(url, act, form_id){
    // console.info(url+act + "     " + form_id);
    // return;
    var formData = new FormData(document.getElementById(form_id));
    $.ajax({
        type:"post",
        url:url + act,
        data : formData,
        processData: false,
        contentType: false,
        error:function (data){
        alert('服务器忙');
        console.info(data);
    },
    success:function (data){
        console.info(data);
        $("#hint_content1").empty().append(data.message);
        $("#my-alert1").modal('show');
        if(data.check)
        {
            $('#close_btn1').unbind('click');
            $('#close_btn1').on("click", jump(url, form_id));
            // alert('添加成功');

        }

    }
    })


}


function  jump(url, form_id){
    // $('#' + form_id).attr("action", url + "index");
    // $('form').submit();
    window.location=url+'index';

}
